package com.collectplus.express.view;

import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ScrollView;

public class MyScrollView extends ScrollView {

	private boolean isScrollable;

	public MyScrollView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public void setScrollable(boolean scrollable) {
		isScrollable = scrollable;
	}

	@SuppressLint("ClickableViewAccessibility")
	@Override
	public boolean onTouchEvent(MotionEvent ev) {
		if (isScrollable) {
			return super.onTouchEvent(ev);
		} else {
			return false;
		}
	}
}
